package jp.syuriken.snsw.terenaibot.format.function;

import jp.syuriken.snsw.terenaibot.format.CompileArg;
import jp.syuriken.snsw.terenaibot.format.FormatSyntaxException;
import jp.syuriken.snsw.terenaibot.format.PrecompiledSyntaxGroup;

/**
 * TODO snsoftware
 * 
 * @author $Author: snswinhaiku.lo@gmail.com $ */
public class EqualFunction extends AbstractFormatFunction {
	
	@Override
	public String getReturnValue(PrecompiledSyntaxGroup[] args, CompileArg compileArg) throws FormatSyntaxException {
		checkArgLength(args, compileArg, "equal", 2);
		return Boolean.toString(args[0].format(compileArg).equals(args[1].format(compileArg)));
	}
}
